package net.lzzy.lxq.controller;

import org.springframework.web.bind.annotation.*;


public class UserController {

    /*@Autowired
    UserService service;

    @GetMapping("/get_users")
    public List<User> getAll(){
        return service.getAll();
    }

    @PostMapping(value = "/login_user")
    public Map<String,Object> login(@RequestBody Map<String,String> map){
        User user=service.getUser(map.get("account"), map.get("password"));
        System.out.println("account="+map.get("account")+" and password="+map.get("password"));
        Map<String,Object> resultJson=new HashMap<>();
        if (user==null){
            resultJson.put("resultCode",1);
            return resultJson;
        }
        resultJson.put("resultCode",0);
        resultJson.put("user",user);
        return resultJson;
    }

    @PostMapping("/register_user")
    public Map<String,Object> registerUser(@RequestBody Map<String,String> param){
        User user=service.addUser(param.get("name"),param.get("password"));
        Map<String,Object> resultJson=new HashMap<>();
        if (user==null){
            resultJson.put("resultCode",1);
            return resultJson;
        }
        resultJson.put("resultCode",0);
        resultJson.put("user",user);
        return resultJson;
    }*/
}
